package ControlLayer;



import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The test class DVDCtrTest.
 *
 * @author  (your name)
 * @version (a version number or a date)
 */
public class DVDCtrTest
{
    private ControlLayer.DVDCtr dVDCtr1;

    /**
     * Default constructor for test class DVDCtrTest
     */
    public DVDCtrTest()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    @Before
    public void setUp()
    {
        dVDCtr1 = new ControlLayer.DVDCtr();
    }

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    @After
    public void tearDown()
    {
    }

   

    @Test
    public void DVDCtr_all()
    {
        dVDCtr1.createDVD(1, "A", "A", "A");
        ModelLayer.DVD dVD1 = dVDCtr1.findDVD(1);
        assertEquals(dVD1, dVD1);
        dVDCtr1.createCopy(1, "c1", "1", 1);
        ModelLayer.Copy copy1 = dVDCtr1.findCopy(1, "c1");
        assertEquals(copy1, copy1);
        dVDCtr1.createDVD(2, "B", "B", "B");
        ModelLayer.DVD dVD2 = dVDCtr1.findDVD(2);
        assertEquals(dVD2, dVD2);
        dVDCtr1.createCopy(2, "c2", "2", 2);
        ModelLayer.Copy copy2 = dVDCtr1.findCopy(2, "c2");
        assertEquals(copy2, copy2);
        dVDCtr1.updateDVD(2, "updated", "updated", "updated");
        ModelLayer.DVD dVD4 = dVDCtr1.findDVD(2);
        assertEquals(dVD2, dVD4);
        dVDCtr1.updateCopy(1, "c1", "updated", 34);
        dVDCtr1.listAllDvds();
        dVDCtr1.deleteCopy(2, "c2");
        dVDCtr1.listAllDvds();
        dVDCtr1.deleteDVD(1);
        dVDCtr1.listAllDvds();
    }
}


